package com.startup.yellocar.dto;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Id;

@Entity
@Table(name = "transaction")
public class TransactionDTO {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "idusertravel")
	private UserTravelDTO userTravel;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "idkitty")
	private KittyDTO kitty;
	
	@Column(name = "debit")
	private long debit;
	
	@Column(name = "credit")
	private long credit;
	
	
	@Column(name="payementmode") 
	@Enumerated(EnumType.STRING)
	private PaymentModeEnum payementMode;
	
	@Column(name = "date")
	private Date date;
	
	
	@Column(name = "datecreate", updatable = false, insertable = false)
	private Date dateCreate;

	
	
	public TransactionDTO() {
		super();
		// TODO Auto-generated constructor stub
	}

	public TransactionDTO(long debit, long credit,
			PaymentModeEnum payementMode, Date date) {
		super();
		this.debit = debit;
		this.credit = credit;
		this.payementMode = payementMode;
		this.date = date;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public UserTravelDTO getUserTravel() {
		return userTravel;
	}

	public void setUserTravel(UserTravelDTO userTravel) {
		this.userTravel = userTravel;
	}

	public KittyDTO getKitty() {
		return kitty;
	}

	public void setKitty(KittyDTO kitty) {
		this.kitty = kitty;
	}

	public long getDebit() {
		return debit;
	}

	public void setDebit(long debit) {
		this.debit = debit;
	}

	public long getCredit() {
		return credit;
	}

	public void setCredit(long credit) {
		this.credit = credit;
	}

	public PaymentModeEnum getPayementMode() {
		return payementMode;
	}

	public void setPayementMode(PaymentModeEnum payementMode) {
		this.payementMode = payementMode;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Date getDateCreate() {
		return dateCreate;
	}

	public void setDateCreate(Date dateCreate) {
		this.dateCreate = dateCreate;
	}


	
	
	


}
